<?php
/**
 * 
 * @author spring
 * @version 2014-6-7 上午9:37:58
 */
class  Controller_Account  extends Controller_Admin {
	
/**
 *汇率的新增查询与修改
 *
 */
    public function before()
    {
    	try {
    		  ACL::Required('mouth cost control');
    	} catch ( HTTP_Exception_403 $e ) {
				Message::error('sorry，你没有权限进这个目录');
    		$this->request->redirect ( URL::base (true) );
    	}
        parent::before();
    }
 	/**
 	 * 
 	 * Description
 	 * @param field_type  bare_field_name 注释
 	 */
    
 	public function action_index()
 	{
 		$this->title='开关账';
 		$config = Config::load('site');
 		if(!$config['close_bill']){
 			$config->set('close_bill','2014-01-01');
 		}
 		$content=View::factory("delivery/close_bill")->set('time',$config['close_bill']);
 		$this->response->body($content);
 	}
 	
 	
 	public function action_close_bill()
 	{
 		$time=isset($_GET['close_time'])?$_GET['close_time']:'2014-01-01';
 		$config = Config::load('site');
 		$config->set('close_bill',$time);
 		echo 'ok';
 	}

    public function action_update_bill()
    {
        $this->title='更新库存库存成本';
        $view=View::factory("inventory/update_bill");
        $this->response->body($view);
    }

}
